<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,initial-scale=1">
<meta name="keywords" content="果果,果果网,果果街,淘宝网导购,淘宝母婴,母婴用品,母婴产品,母婴网购,怀孕,孕期,婴幼儿,儿童,0-1岁,1-3岁,3-6岁,妈妈购物分享,逛淘宝,童装,童鞋,玩具,早教,启蒙,亲子,亲子装,纸尿裤,奶粉,母婴类美丽说,母婴类蘑菇街,母婴类爱乐活" />
<meta name="description" content="看看妈妈们为宝宝淘到的好东西，参加品牌母婴电商限时高额返利活动，推荐别人购买自己拿佣金，果果街是妈妈分享育儿消费经验，网购省钱的好地方。" />
<title>首页 - 果果街 </title>
<link href="/wap/css/base.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/wap/js/jquery-1.7.2.min.js" ></script>
<script type="text/javascript" src="/wap/js/amoy.js"></script>
<script type="text/javascript">
	$(function(){
		$.lbShow({
			picUL:"lb_pic",
			numsUL:"lb_nums",
			styles:"hover",
			time:3000
		});
	});
</script>
</head>

<body>
	<div class="w640 mg">
    	<div class="head clearfix">
        	<a href="javascript:;" class="logo"><img src="/wap/images/logo.png" class="block" /></a>
            <p class="tip">妈妈们网上购物的好地方！</p>
        </div>
        <c:if test="${fn:length(lunboList) > 0}">
       	<div class="lb_wrap">
        	<ul id="lb_pic">
        		
        		<c:forEach items="${lunboList}" var="lunbo" varStatus="status">
        			
        			<li <c:if test="${status.index == 0}">class="current"</c:if>
        				<c:if test="${status.index != 0}">style="display:none;"</c:if>
        			><a 
        			<c:if test="${not empty lunbo.hyperlink}">href="${lunbo.hyperlink}"</c:if>
        			<c:if test="${empty lunbo.hyperlink}">href="/wap/taobao.htm?pid=${lunbo.title}&mid=${mid}"</c:if>
        			><img src="${lunbo.picture}" width="320" class="block" /></a></li>
        		</c:forEach>
            	
            </ul>
            <ul class="lb_nums" id="lb_nums">
            	<c:forEach items="${lunboList}" var="lunbo" varStatus="status">
            		<li <c:if test="${status.index == 0}">class="current"</c:if>
        			><i class="icon_circle_s1"></i></li>
            	</c:forEach>
            </ul>
        </div>
        </c:if>
        <div class="pro_columns">
        	<div class="pro_column">
            	
            </div>
            <div class="pro_column">
            </div>
        </div>
    </div>
    <div class="loading" style="display:none;">
    	<img src="/wap/images/waiting.gif" /><span>果果街正在努力加载中...</span>
    </div>
    <script type="text/javascript">
    	var page = 0;
    	var totalpage = ${pageModel.totalPage};
    	$(function(){
    		
    		loadList();
    		var sTop,allHei,winHei;
			winHei=$(window).height();
			$(window).bind("scroll",function(){
				sTop=$(window).scrollTop();
				allHei=$(document).height();
				if(allHei-sTop-winHei<=500){
					loadList();
				}
			});
		});
    	
    	function loadList(){
    		if(page < totalpage){
    			page += 1;
    			$("div.loading").show();
        		$.post("/wap/prolist.htm",{
        			page : page
        		},function(data){
        			$("div.loading").hide();
        			var ret = $.parseJSON(data);
        			if(ret.success = 'true'){
        				var columnIndex=1;
            			var proData=ret.list;
            			var proColumns=$("div.pro_column");
            			$.each(proData,function(index,item){
            				var html='<div class="pro_item">'
            						+'<a href="/wap/taobao.htm?pid='+item.proId+'&mid=${mid}" class="block"><img src="'+item.picUrl+'" width="151" class="block" /></a>'
                                	+'<a href="/wap/taobao.htm?pid='+item.proId+'&mid=${mid}" class="title">'+item.name+'</a>'
                               		+'<a href="/wap/taobao.htm?pid='+item.proId+'&mid=${mid}" class="buy"><i class="price">￥'+item.price+'</i>去店铺购买</a>'
                            		+'</div>';
            				switch(columnIndex){
            					case 1:proColumns.eq(0).append(html);columnIndex+=1;break;
            					case 2:proColumns.eq(1).append(html);columnIndex=1;break;
            				}
            			});
            			
            		}else{
        				alert(ret.msg);
        			}
        			
        		});
    		}
    		
    	}
    </script>
</body>
</html>
